package cn.itsource.pethome.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

//店铺表对应实体类
@Data
@ToString //相当于重写toString方法
@AllArgsConstructor //相当于全参构造器
@NoArgsConstructor //相当于无参构造器
@Table(name = "t_shop")
@ApiModel(description = "店铺表对应实体类")
public class Shop extends BaseDomain {

    @ApiModelProperty(value = "店铺名称")
    private String name;
    @ApiModelProperty(value = "联系电话")
    private String tel;
    @ApiModelProperty(value = "注册时间")
    @Column(name = "register_time")
    @JsonFormat(shape =JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd",timezone ="GMT+8")
    private Date registerTime;
    @ApiModelProperty(value = "店铺状态 0:可用   1:不可用")
    private Integer state;
    @ApiModelProperty(value = "门店地址")
    private String address;
    @ApiModelProperty(value = "门店logo")
    private String logo;
    @ApiModelProperty(value = "门店管理员id  关联Employee表的ID")
    @Column(name = "admin_id")
    private Long adminId;//关联Employee表的ID

    @Transient
    @ApiModelProperty(value = "门店管理员的名称")
    private Employee admin;
    @Transient
    @ApiModelProperty(value = "门店管理员的名称")
    private String adminName;
}
